import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home/Home.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      meta: { isNav: true }, // 控制底部导航栏的显示与隐藏
      component: Home
    },
    {
      path: '/category',
      name: 'category',
      meta: { isNav: true },
      component: () => import('./views/Category/Category.vue')
    },
    {
      path: '/cart',
      name: 'cart',
      meta: { isNav: false },
      component: () => import('./views/Cart/Cart.vue')
    },
    {
      path: '/mine',
      name: 'mine',
      meta: { isNav: true },
      component: () => import('./views/Mine/Mine.vue')
    },
    {
      path: '/searchResult',
      name: 'searchResult',
      meta: { isNav: false },
      component: () => import('./views/Category/SearchResult/SearchResult.vue')
    },
    {
      path: '/detail',
      name: 'detail',
      meta: { isNav: false },
      component: () => import('./views/Detail/Detail.vue')
    },
    {
      path: '/orderConfirm',
      name: 'orderConfirm',
      meta: { isNav: false },
      component: () => import('./views/Mine/Order/OrderConfirm/OrderConfirm.vue')
    },
    {
      path: '/orderList',
      name: 'orderList',
      meta: { isNav: false },
      component: () => import('./views/Mine/Order/OrderList/OrderList.vue')
    },
    {
      path: '/orderDetail',
      name: 'orderDetail',
      meta: { isNav: false },
      component: () => import('./views/Mine/Order/OrderDetail/OrderDetail.vue')
    },
    {
      path: '/addressList',
      name: 'addressList',
      meta: { isNav: false },
      component: () => import('./views/Mine/Address/AddressList/AddressList.vue')
    },
    {
      path: '/addressEdit',
      name: 'addressEdit',
      meta: { isNav: false },
      component: () => import('./views/Mine/Address/AddressEdit/AddressEdit.vue')
    },
    {
      path: '/pay',
      name: 'pay',
      meta: { isNav: false },
      component: () => import('./views/Pay/Pay.vue')
    }
  ]
})
